/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.marcelo.agro.core;

import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
import org.jdesktop.swingx.JXTable;
import org.marcelo.agro.constantes.IConstantes;
import org.openide.util.Lookup;
import org.openide.util.lookup.AbstractLookup;
import org.openide.util.lookup.InstanceContent;

/**
 *
 * @author marcelo
 */
public class EntitiesJXTable  extends JXTable implements Lookup.Provider, PropertyChangeListener{

    /**
     * @param args the command line arguments
     */
    
    private InstanceContent content = new InstanceContent();
    private AbstractLookup lookup = new AbstractLookup(content);
     
    public EntitiesJXTable() {
        int condition = JComponent.WHEN_FOCUSED;
        
        InputMap inputMap = getInputMap(condition);
        //Cr4eando las entradas de datos
        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), IConstantes.DELETE);
        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0), IConstantes.EDIT);
        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0), IConstantes.REFRESH);
        
        
    }

    @Override
    public Lookup getLookup() {
        return lookup;
    }

    @Override
    public void propertyChange(PropertyChangeEvent evt) {
        if (evt.getPropertyName().equals("")) {
            
        }
    }
    
    
    
    
}
